<!--
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2021-12-07 10:36:23
 * @LastEditTime: 2021-12-13 10:36:02
 * @LastEditors: 赵大壮
-->
<template>
  <div class="sidebar">
    <el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="$store.state.collapseStatus"
      background-color="#324157" text-color="#bfcbd9" active-text-color="#20a0ff" unique-opened router
      @select="selectSide">
      <template v-for="item in items">
        <template v-if="item.subs">
          <el-submenu :index="item.index" :key="item.index">
            <template #title>
              <i :class="item.icon" class="mr-w10 text-f18"></i>
              <span class=" text-f16">{{ item.title }}</span>
            </template>
            <template v-for="subItem in item.subs">
              <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
                <template #title><span class="text-f15">{{ subItem.title }}</span></template>
                <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">
                  {{ threeItem.title }}</el-menu-item>
              </el-submenu>
              <el-menu-item v-else :index="subItem.index" :key="subItem.index"><span class="text-f15 pl-w15">{{ subItem.title }}</span>
              </el-menu-item>
            </template>
          </el-submenu>
        </template>
        <template v-else>
          <el-menu-item :index="item.index" :key="item.index">
            <i :class="item.icon" class="mr-w10 text-f18"></i>
            <template #title><span class=" text-f16">{{ item.title }}</span></template>
          </el-menu-item>
        </template>
      </template>
    </el-menu>
  </div>
</template>

<script src="./Index.ts"></script>
<style src="./Index.less" lang="less" scoped>
</style>
